package com.itheima.mapper;

import com.itheima.pojo.CheckGroup;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.Mapping;

import java.util.List;
import java.util.Map;

@Mapper
public interface CheckGroupDao {
    //根据 项目编码/项目名称/助记码模糊查询
    List<CheckGroup> findPage(String queryString);

    //根据id删除
    @Delete("delete from t_checkgroup where id = #{id}")
    void deleteById(Integer id);

    @Insert("insert into t_checkgroup(code,name,helpCode,sex,remark,attention) values(#{code},#{name},#{helpCode},#{sex},#{remark},#{attention})")
    void addCheckGroup(CheckGroup checkGroup);

    @Select("select * from t_checkgroup where id = #{id}")
    CheckGroup findById(Integer id);

    //根据传进来的checkgroup对象中的除id外所有的值来查询id
    List<Integer> findBycheckGroup(CheckGroup checkGroup);

    void editCheckGroup(CheckGroup checkGroup);

    @Select("select * from t_checkgroup")
    List<CheckGroup> findAll();
}
